home *** CD-ROM | disk | FTP | other *** search
- u
-
- An Introduction to C-128 CP/M
-
- CPM1.TXT rev 1a 96-11-01
-
- THIS DOCUMENT IS COPYRIGHT (C) 1988,
- 1996 BY HERNE DATA SYSTEMS LTD. THE
- MATERIAL CONTAINED HEREIN MAY BE
- FREELY USED FOR PERSONAL INFORMATION
- ONLY. IF YOU REPRODUCE IT, THIS
- COPYRIGHT NOTICE MUST NOT BE REMOVED.
- THIS MATERIAL MAY NOT BE EXPLOITED
- FOR COMMERCIAL PURPOSES.
-
- Herne Data Systems Ltd.,
- PO Box 250, Tiverton, ON N0G 2T0
- CANADA.
- Voice/fax 519-366-2732,
- e-mail herne@herne.com
- internet: http://www.herne.com
-
-
- An Introduction to C-128 CP/M
-
- What is CP/M?
- CP/M stands for 'Control
- Program/Monitor'. It is not a
- programming language, the way BASIC or
- Fortran is, but a micro computer
- operating system, much like the KERNAL
- used in C-128 native mode and other
- 6502 based Commodore computers. CP/M
- was developed in the 1970's by Digital
- Research Inc. (DRI) for Intel 8080
- microprocessor based computers that
- allows a given program to run on a
- wide variety hardware configurations
- with little or no changes. It was
- later extended to run on Zilog Z80
- based computers as well as others.
- (The Z80 used in the C-128 is
- 'upwardly compatible' with the 8080.
- That is, its machine language
- instruction set includes everything
- that the 8080 has and more.) With
- CP/M, a software developer has a
- uniform set of basic operating system
- functions to work with (such as screen
- output, keyboard input & disk access
- routines). To the end user, these
- system functions remained fixed, no
- matter what computer the program is
- actually running on, thus providing a
- very high degree of portability. (You
- need only develop one version of a
- program which operates under the CP/M
- system instead of having a different
- version for brand x, y, and z
- computers.) For those who may be
- interested, there is also a 16-bit
- version of CP/M designed to run on
- 8086/88 type computers called CP/M-86,
- a multi user version called MP/M and a
- 16/32 bit version for the MC68000 chip
- series called CP/M-68k.
-
- CP/M is divided up into four main
- components: the BIOS (Basic Input
- Output System); the BDOS (Basic Disk
- Operating System), the CCP (Console
- Command Processor) and the TPA
- (Transient Program Area). Each of
- these parts will be discussed in later
- chapters. Of the four parts, only the
- BIOS is hardware dependent. It acts
- as the messenger between the other
- parts of the system and the actual
- hardware. That is, a separate custom
- BIOS must be created for each system
- that runs CP/M.
-
- CP/M on the C-128
- The version of CP/M used on the C-128
- is termed 'CP/M Plus' or 'CP/M version
- 3'. This is the latest 8-bit CP/M
- version, and is also used on other
- recent CP/M based computers such as
- the Epson CF:X-10, and TRS-80 Model 4.
-
- The minimum configuration for running
- CP/M on the C-128 is the C- 128, one
- disk drive, and a 40 or 80 column
- monitor. For speed and ease of use, a
- fast disk drive (i.e. the 1571 or
- 1581) is recommended along with the 80
- column monitor. For disk intensive
- programs (many CP/M programs are), a
- 1700 or 1750 RAM expansion unit is
- highly recommended as it can be used
- as a super fast RAM disk. A printer
- (device 4 or 5) along with a modem
- will round out your system. (Use of
- the modem requires CP/M release dated
- DEC 85 or later.)
-
- To start up CP/M on the C-128 or 128
- D, put the CP/M BOOT disk in disk
- drive device 8 and turn on the drive
- and then the computer (in that order).
- If the computer and drive are already
- on, insert the boot disk, then press
- the reset button on the C-128 or type
- in BOOT followed by pressing <return>,
-
- After a few moments and some sign-on
- status message screens, you will see a
- prompt on the screen in the form of
- the letter A followed by a 'greater
- than' sign & a flashing cursor A>
-
- Congratulations! You have just
- started up CP/M successfully and are
- ready to enter your first CP/M
- command. Just for fun, type in the
- letters DIR then press <return>.
- A 'directory' or 'catalog' of the
- contents of the boot disk should be
- displayed on the screen.
-
- The Status Line The bottom line of the
- screen display (i.e. the 25th line) on
- either the 40 column or 80 column
- screen is used by CP/M as a status
- line to display various system
- messages. These are outlined below.
-
- Disk Status
- C-128 CP/M has an optional disk status
- window displayed at the bottom right
- corner of the screen. The format of
- the status window is as follows:
-
- O Dtt ss
-
- where:
-
- O = Operation, either R or W
- indicating a Read or Write
- D = the logical drive (A,B,C,D, etc)
- tt = the track number currently being
- read or written
- ss = the sector number currently
- being read or written
-
- Normally, the track and sector
- numbers are separated by a space. If
- the disk is formatted in MFM, and the
- track and sector are separated by a
- '-', then the second side of the disk
- is currently being accessed. You can
- toggle this status window ON/OFF by
- the <CONTOL>-<RUN/STOP> key
- combination.
-
- Note that window is also erased
- temporarily, i.e. until the next disk
- access, when you (or your application
- program) perform a screen clear.
-
- The disk status window is not used for
- RAM disk operations (i.e. 1700/1750
- RAM expansion unit). You may also
- note that, due to a bug in the fast
- bus GCR sector translation routine,
- the sector numbers displayed during
- reading & writing of both single and
- double sided C-128 native GCR type
- CP/M disks are incorrect when using a
- 1571 drive. Correct numbers are,
- however, displayed when using a 1541
- drive to access these disks.
-
- MFM Disk Type Selection
- C-128 CP/M supports a number of
- industry standard MFM disk types (such
- as KayPro, Osborne, IBM, Epson, etc.)
- when used with a 1571 disk drive.
- However, CP/M sometimes cannot
- automatically distinguish between two
- very similar disk types such as KayPro
- II & KayPro IV. For example, although
- the KayPro II is a single sided disk
- & the KayPro IV is a double sided one,
- CP/M can confuse the two because both
- have ten sectors of 512 bytes per
- track, numbered 0 to 9 on side 0.
- CP/M looks at the physical format of
- side 0 to determine the foreign disk
- type. When two or more matches are
- found in its internal parameter table,
- you are asked to manually chose which
- one you want.
-
- When CP/M cannot uniquely identify the
- foreign disk format being accessed,
- the program will pause momentarily and
- the disk type window will open up at
- the center of the bottom line of the
- screen to display the name of the
- first match, such as KayPro II, in
- reverse video. At this point there
- are several things that you can do.
-
- First, if you are sure that the disk
- is of the type displayed,
- simply press <return> or <enter>.
- This will select the currently
- displayed entry. If you change disks,
- you will have to go through the
- selection process over again.
-
- Second, if you are going to be using
- this disk format repeatedly and do not
- wish to re-select each time you change
- disks, you can 'lock in' the selected
- type by pressing <control>-<return>.
- This action has the effect of
- performing a burst mode 'forced login'
- on the drive each time you change
- disks. If you insert a new type of
- disk while locked in, you will go back
- to the selection window.
-
- Note: The forced login commands are
- different for the 1571 & 1581 drives
- therefore, <control>-<return> should
- not be used with a 1581 drive. If you
- do use it on a 1581 and change disks,
- the results may be unpredictable, even
- resulting in system crash
-
- The third option is used to display
- and select the alternate disk choices.
- Use the cursor left & right keys in
- the cursor control keypad (above the
- main keyboard) to scroll through the
- list of choices. In the example used
- above, the display should change
- between KayPro II & KayPro IV. When
- the correct entry is highlighted, you
- can use either of the two methods
- outlined above for making selections.
-
- Note that because you are in a
- suspended program loop, nothing else
- can be done until you make a selection
-
- PAUSE
- The key labelled NO SCROLL executes
- a PAUSE function. Although this key
- appears to have the same effect as
- <control>-s (stop) & <control>-CF:
- (start) for pausing to read screen
- dumps, it is not actually related in
- terms of the internal workings of the
- operating system. Using NO SCROLL
- sends the program into an endless loop
- while displaying the message 'PAUSE'
- on the status line. Because of this,
- NO SCROLL cannot be used to pause a
- display before pressing <control>-p to
- toggle the printer, or <control>-c to
- abort execution of a program.
-
- To resume execution after a PAUSE
- function, press NO SCROLL again (for
- AUG or DEC release only) or RETURN
- (for MAY release only).
-
- Disk Drives
- C-128 CP/M supports a variety of
- different disk drives (virtually any
- serial bus drive is either supported
- directly or can be easily adapted).
- However, since CP/M tends to be a disk
- intensive operating system (i.e. it
- makes heavy use of temporary disk
- files, overlay files, working files,
- etc.), a fast bus drive (i.e. a 1571
- or 1581) is highly recommended for
- maximum disk access speed.
-
- CP/M in general can support up to 16
- disk drives, usually labelled A: to P:
- On the C-128 implementation, normally
- only a maximum of 6 drives are
- actually supported. In the default
- system configuration, these are:
-
- DRIVE DEVICE
- A: serial port device 8 drive 0
- B: serial port device 9 drive 0
- C: serial port device 10 drive 0
- D: serial port device 11 drive 0
- E: serial port device 8, drive 0
- (see 'Virtual Disk Drive' below)
- M: 17xx RAM expansion unit
- (see 'RAM Disk' below)
-
- Virtual Disk Drive
- The physical disk drive A can be used
- as logical drive A or as the 'virtual'
- or 'phantom' logical disk drive E.
- Whenever you access drive E (for
- example by doing DIR E:, or PIP
- E:=A:FILE1), the system will display a
- prompt on the status line asking you
- to insert the diskette for drive E
- (respond by putting whatever diskette
- you want into physical drive A, then
- type <return>). The next time you
- access logical drive A, the system
- will prompt you to insert the A
- diskette in drive A. Again, insert
- the desired diskette & type <return>.
- Note that CP/M does not actually
- check to see if you in fact changed
- the disk. It will accept whatever is
- in the drive when you press <return>
- as being the correct disk.
-
- RAM Disk
- When the 1700 (128k byte) or 1750
- (512k byte) RAM expansion unit (REU)
- is connected to the C-128 in CP/M
- mode, it becomes an ultra fast RAM
- disk, normally assigned to CP/M drive
- M:. That is, any CP/M command or
- transient utility can access the REU
- as drive M:, just like it can any
- other 'disk drive' connected to the
- system. Note that this is totally
- separate from the virtual disk drive
- discussed above.
-
- Unlike a physical disk drive, the
- contents of the RAM disk are not
- preserved when the C-128 is turned
- off. However, the contents are
- preserved when the reset button is
- pressed momentarily to re-boot the
- system, even if you enter C-128 native
- mode or C-64 mode before returning to
- CP/M mode (providing, of course, you
- do not alter the contents either
- accidentally or intentionally by
- running some other program while in
- one of these other operating modes).
-
- Note that in order to use the RAM
- disk, you must have the C-128 CP/M
- release dated 6 DEC 85 or later.
-
- The Screen
- C-128 CP/M supports both the 40 column
- and 80 column display screens. The
- screen which is initially active is
- determined by the position of the
- 40/80 switch on boot up. After
- booting, the screen can be selected
- using the DEVICE utility (see Chapter
- 3) or equivalent. The screen can be
- changed during the execution of a user
- program by setting the CONOUT
- redirection flag in the system control
- block (see Chapter 9).
-
- The 40 column screen is configured as
- a window on a larger 80 column
- 'virtual' screen. This allows
- commands and programs to think that
- they are dealing with an 80 column
- wide screen (the default width for
- most CP/M programs).
-
- Use <control>-<left arrow> and
- <control>-<right arrow> to scroll the
- window across the virtual screen (see
- Arrow Keys, below).
-
-
- CONTINUED IN PART 2
-
-